<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>app组件</h3>
        <comp-a></comp-a>
        <hr>
        <comp-b></comp-b>
    </div>
    <hr>

    <template id="compB">
        <div>
            <h1>组件b</h1>
            <p>msg:{{msg}}</p>
            <input type="text" v-model="msg">
            <hr>
            <comp-c></comp-c>
        </div>
    </template>
</body>
<script>
    new Vue({
        el:"#app",
        components:{
            CompA:Vue.extend({
                template:"<h1>组件A：{{info}}</h1>",
                data() {
                    return {
                        info:"info变量"
                    }
                },
            }),
            "comp-b":{
                template:"#compB",
                data() {
                    return {
                        msg:"msg变量"
                    }
                },
                components:{
                    CompC:{
                        template:"<h4>组件</h4>"
                    }
                }
            }
        }
    })
</script>
</html>